FROM php:8.1-fpm
#更换apt镜像源
RUN echo "deb https://mirrors.aliyun.com/debian/ stable main contrib non-free" > /etc/apt/sources.list
RUN apt-get update && apt-get install -y zip \
    curl \
    git \
    unzip \
    librabbitmq-dev \
    libfreetype6-dev \
    libjpeg62-turbo-dev \
    libmcrypt-dev \
    libpng-dev \
    zlib1g-dev \
    libzip-dev \
    libssl-dev \
    libc-ares-dev \
    libcurl4-openssl-dev \
    ffmpeg \
&& pecl install redis && docker-php-ext-enable redis \
&& pecl install -D 'enable-sockets="no" enable-openssl="yes" enable-http2="yes" enable-mysqlnd="yes" enable-swoole-json="no" enable-swoole-curl="yes" enable-cares="yes"' swoole && docker-php-ext-enable swoole \
&& pecl install amqp-1.11.0 && docker-php-ext-enable amqp \
&& docker-php-ext-install pdo pdo_mysql mysqli pcntl bcmath sockets gd zip \
#安装composer
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ \
&& composer self-update
#命令
CMD ["php-fpm"]